package com.zhike.b2b.search;

import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

public class FindAllFile
{
  public static List pathmarry;

  public FindAllFile(String paramString1, String paramString2)
  {
    pathmarry = new ArrayList();
    delAllFile(paramString1, paramString2);
  }

  public static String delAllFile(String paramString1, String paramString2)
  {
    String str1 = "";
    File localFile1 = new File(paramString1);
    if (!localFile1.exists())
      return null;
    if (!localFile1.isDirectory())
      return null;
    String[] arrayOfString = localFile1.list();
    File localFile2 = null;
    for (int i = 0; i < arrayOfString.length; i++)
    {
      if (paramString1.endsWith(File.separator))
        str1 = paramString1 + arrayOfString[i];
      else
        str1 = paramString1 + File.separator + arrayOfString[i];
      localFile2 = new File(str1);
      if (localFile2.isDirectory())
      {
        delAllFile(paramString1 + "/" + arrayOfString[i], paramString2);
      }
      else
      {
        HashMap localHashMap = new HashMap();
        String str2 = str1.substring(str1.lastIndexOf(".") + 1, str1.length());
        str2 = str2.toLowerCase();
        if ((!str2.equals("ppt")) && (!str2.equals("doc")) && (!str2.equals("xls")) && (!str2.equals("pdf")) && (!str2.equals("txt")))
          continue;
        str1 = str1.replaceAll(paramString2, "");
        localHashMap.put("path", str1);
        pathmarry.add(localHashMap);
      }
    }
    return str1;
  }
}

